home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / keyservh / examples.cls < prev    next >
Encoding:
Visual Basic class definition  |  1999-08-20  |  2.1 KB  |  66 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "ExampleService"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = True
  14. '****************************************************************************************************
  15. '   Copyright (c) Key Technology Pty Ltd 1999, All Rights Reserved.
  16. '   Web site: http://www.keytech.com.au  Email: info@keytech.com.au
  17. '****************************************************************************************************
  18.  
  19. Option Explicit
  20.  
  21. '
  22. ' This is a stub service that does nothing.
  23. '
  24.  
  25. ' Must implement IService to be hosted as a service
  26. Implements IService
  27.  
  28. Private Property Get IService_Pausable() As Boolean
  29.     ' Only support pause/continue if it makes sense
  30.     IService_Pausable = True
  31. End Property
  32.  
  33. Private Sub IService_OnStart()
  34.     App.LogEvent "Example Service starting", vbLogEventTypeInformation
  35.     
  36.     ' Do whatever is required to start the service
  37.     ' but return as quickly as possible
  38. End Sub
  39.  
  40. Private Sub IService_OnStop()
  41.     App.LogEvent "Example Service stopping", vbLogEventTypeInformation
  42.     
  43.     ' Do whatever is required to stop the service
  44.     ' but return as quickly as possible
  45. End Sub
  46.  
  47. Private Sub IService_OnPause()
  48.     ' Will only be called if pausable
  49.     App.LogEvent "Example Service pausing", vbLogEventTypeInformation
  50. End Sub
  51.  
  52. Private Sub IService_OnContinue()
  53.     ' Will only be called if pausable
  54.     App.LogEvent "Example Service continuing", vbLogEventTypeInformation
  55. End Sub
  56.  
  57. Private Sub IService_OnControl(ByVal OpCode As Long)
  58.     ' Handle service specific controls
  59.     App.LogEvent "Example Service received control " & OpCode, vbLogEventTypeInformation
  60. End Sub
  61.  
  62. Private Sub IService_OnShutdown()
  63.     ' Perform any shutdown specific processing
  64.     App.LogEvent "Example Service shutting down", vbLogEventTypeInformation
  65. End Sub
  66.